<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
function wait_number($id){
    if($id){
        $model = new \app\admin\model\Participant();
        $count = $model->where('active_id',$id)->where('status',0)->count();
        if($count){
            return $count.'个待审核人员';
        }
        return '无待审核人员';
    }
    return '';
}

function create_sign($params,$app_key=''){
    ksort($params);
    $sign = '';
    foreach($params as $key=>$val){
        if($key != 'Sign' && $key != 'sign' && $val != ''){
            $sign .= $key.$val;
        }
    }
    return strtoupper(md5($app_key.$sign.$app_key));
}